import request from '@/utils/request'

// 根据id查询用户岗位
export const getUserPostById = (id) =>
  request({
    url: `/sys/userPost/${id}`,
    method: 'get'
  })

// 分页查询用户岗位
export const listUserPostPage = (search) =>
  request({
    url: '/sys/userPost/list',
    method: 'post',
    data: search
  })

// 查询所有用户岗位
export const listUserPostAll = (search) =>
  request({
    url: '/sys/userPost/listAll',
    method: 'post',
    data: search
  })

// 保存/更新用户岗位
export const saveUserPost = (userPost) =>
  request({
    url: '/sys/userPost/save',
    method: 'post',
    data: userPost
  })

// 删除用户岗位
export const deleteUserPost = (userPost) =>
  request({
    url: '/sys/userPost/delete',
    method: 'post',
    data: userPost
  })

// 批量保存/更新用户岗位
export const bulkInsertUserPost = (userPosts) =>
  request({
    url: '/sys/userPost/bulkInsert',
    method: 'post',
    data: userPosts
  })

// 批量更新用户岗位
export const bulkUpdateUserPost = (userPosts) =>
  request({
    url: '/sys/userPost/bulkUpdate',
    method: 'post',
    data: userPosts
  })

// 批量删除用户岗位
export const bulkDeleteUserPost = (userPosts) =>
  request({
    url: '/sys/userPost/bulkDelete',
    method: 'post',
    data: userPosts
  }) 